package it.openHWHackaton.arduinoTableSoccer;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class Background extends Actor{
	Texture texture = new Texture(Gdx.files.internal("data/background.png"));
	Texture banner = new Texture(Gdx.files.internal("data/Banner.png"));

	int w=Gdx.graphics.getWidth();
	int h=Gdx.graphics.getHeight();
	public Background(){
		setBounds(getX(),getY(),texture.getWidth(),texture.getHeight());
    }
	@Override
	public void draw(SpriteBatch batch, float alpha){
		batch.draw(texture, 0,0+((h-w/AspectRatio.getBackgroundAspectRatio())/2),w,w/AspectRatio.getBackgroundAspectRatio());
		batch.draw(banner, w-((h-w/AspectRatio.getBackgroundAspectRatio())/2)*AspectRatio.getBannerAspectRatio(),0+((h-w/AspectRatio.getBackgroundAspectRatio())/2)+w/AspectRatio.getBackgroundAspectRatio(),((h-w/AspectRatio.getBackgroundAspectRatio())/2)*AspectRatio.getBannerAspectRatio(),((h-w/AspectRatio.getBackgroundAspectRatio())/2));

		//batch.draw(texture,0,0);
	}

}
